	var dd		=	new Date();
	var	miliDD	=	dd.getMilliseconds();
	/*______________________________________________________________________________________*/
	function showLoader()
	{
		if(frmComplaintsSubmit())
		{
			$("#cmd_submit").attr("disabled", "disabled");
			$("#tr_loader").show();
			$('#frmComplaints').submit();
		}
	}
	/*______________________________________________________________________________________*/
	function CheckNumericWithZero(id,name)
	{	
		pricepattern = /^[0-9][0-9]*\.?[0-9]*$/; //define patteren for valid user input entry 
		if(pricepattern.test($("#" + id).val()) == false)
		{
			$("#" + id).val("");
			$("#" + id).focus();
			
			 return false;
		}
	}
	
	/*______________________________________________________________________________________*/
	function doSelectOnUC( doSelectValue )
	{
		doSelectValue = doSelectValue.split("()"); 
		var doSelectValue = doSelectValue[1];
		$("#patientTown").val( doSelectValue);
	}
	
	/*______________________________________________________________________________________*/
	
	function doSelectOnDis( doSelectValue )
	{
			$("#patientUC").val("");
			$("#patientTown").val("");	
	
			if( doSelectValue != "LAHORE" )
			{
				$("#patientUC").val( "Others");
				$("#patientTown").val("");	
				$("#patientUC").attr("disabled", "disabled");
				$("#patientTown").attr("disabled", "disabled");
			}
			if( doSelectValue == "LAHORE" )
			{
				$("#patientUC").removeAttr("disabled");
				$("#patientTown").removeAttr("disabled");
			}
			
	}	

	/*______________________________________________________________________________________*/
	function CheckPhoneNumbers(Obj,name)
	{	
	   sText = Obj.value;
	   var ValidChars = "0123456789()[]-+ ";
	   var IsNumber=true;
	   var Char;
	 
	   for (i = 0; i < sText.length && IsNumber == true; i++) 
		  { 
		  Char = sText.charAt(i); 
		  if (ValidChars.indexOf(Char) == -1) 
			 {
				IsNumber = false;
			 }
		  }
	   
	   if(IsNumber == false)
	   {
			 //alert("Please enter valid "+name);
			 Obj.value="";
			 Obj.focus();
	   }
		return true;
	}
	
	/*______________________________________________________________________________________*/
	
	/**
	 * 	This function is somehting which loads the index pages through JQUERY.load method
	 *	@param string url URL of the page which contents need to be loaded and displayed.
	 *	@param string contContainer The container of the page whose contents need to be loaded and displayed from the response.
	 *	@param string wrapper The container of the page whose contents will be updated through the ajax call.
	 *	@param object objLnk The Object of the clicked link.
	
	*/
	function loadPage(url, contContainer, wrapper, objLnk)
	{
	
		//Get the contents of the Wrapper and if those are not empty, just empty those contents and populate with the coming request.
		var txtContents		=	$(wrapper).html();
		
		//Show loading before the contents are loaded.
		if(txtContents != '' && txtContents != undefined)
		{
		 //  $(wrapper).html('');
			 $(wrapper).css({opacity: 0.2});
			 $(wrapper).find('a').click(function(){this.blur();});
		}
	
		var top		=	68;
		var left	=	(($(window).width() / 2) - 100);
	

		if( top < 0 ) top = 0;
		if( left < 0 ) left = 0;	
	
		//If loader is already open
		$('#loader_container').remove();
		
		$(wrapper).before('<span id="loader_container">Loading, Please wait...</span>');	
		
		if(url.indexOf('?') != -1)
			url	=	url + '&' + miliDD;
		else
			url	=	url + '?' + miliDD;
	
		if(contContainer != undefined && contContainer != null && contContainer!= '')
			url		=  url	+ ' ' + contContainer;

		//Load the contents now.
		$(wrapper).load(url,
			function(txtResponse)
			{
				
				if (status == "error")
				{
					var msg = "Sorry but there was an error: ";
					$(wrapper).html(msg + xhr.status + " " + xhr.statusText);
				}
				else
				{
					$(wrapper).css({opacity: 1.0});
					$('#loader_container').remove();
			
				/*	$('#div_PageNavLinks').html($('#comp_data').find('#div_pageNavs').html());
					$('#comp_data').find('#div_pageNavs').remove();
	
					$('#totalRecs').html($('#comp_data').find('#totalRecords').html());
					$('#comp_data').find('#totalRecords').remove();*/
					
				}/*Closing of else*/
							 
			});
		
	}/*Closing of loadPage(...)*/
		
	/*---------------------------------------------------------------------------------------*/
	/*Must define this method. Very essential for ajax based pagination*/
	function showPagination(url, wrapper)
	{	
	
		var is2PostForm	=	true;
		
		if(wrapper == undefined || wrapper == null)
			wrapper	=	'#dv_data';

		if(is2PostForm)
			url	+=  "&" +	$("form").serialize();
			
		loadPage(url, '', wrapper);
	}/*Closing of showPagination() */

	/*---------------------------------------------------------------------------------------*/
	function doSearchSubmit()
	{
		$("#frm_search").submit();		
	}
	/*---------------------------------------------------------------------------------------*/
	
	function setCookie(name,value,days) {
    if (days) {
        var date = new Date();
        date.setTime(date.getTime()+(days*24*60*60*1000));
        var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
	}
	/*---------------------------------------------------------------------------------------*/

	function getCookie(name) {
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	}
	/*---------------------------------------------------------------------------------------*/

	function deleteCookie(name) {
		setCookie(name,"",-1);
	}
